<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:rich="http://richfaces.org/rich">	
<ui:composition template="/pages/layout/masterLayout.xhtml">
	<ui:define name="tituloPagina">Gerenciar Materiais</ui:define>
	<ui:define name="conteudo">
		<t:saveState value="#{gerenciaArquivo.arquivos}" />
		<div style="width: 100%; clear:both;">
			<br/>
			<h1>:: Gerenciamento de Materiais ::</h1>
			<br/>
			<h:form>
				<t:dataTable rows="10" id="tabelaArquivos" binding="#{gerenciaArquivo.tabelaArquivos}" var="arq" value="#{gerenciaArquivo.arquivos}" style="width: 100%" rowClasses="impar,par">
					<f:facet name="header">
						<h:outputText value="Listagem de Arquivos" />
					</f:facet>
					<t:column sortable="false" columnId="idOpcao">
						<f:facet name="header">
							<h:outputText value="Opções" />
						</f:facet>
						<center>							
						<nobr>
						<h:commandButton action="#{gerenciaArquivo.confirmaExclusao}" value="Excluir" id="excluir" image="/resources/images/remover.gif" title="Remover" style="width : 22px; height : 22px; text-align: center;"/> &nbsp;&nbsp;
						<h:commandButton action="#{gerenciaArquivo.selecionaArquivoParaAlteracao}" value="Alterar" id="alterar" image="/resources/images/alterar.gif" title="Alterar" style="width : 22px; height : 22px; align: center;"/> &nbsp;&nbsp;						
						<h:commandButton action="#{gerenciaArquivo.selecionaArquivoParaDetalhamento}" value="Detalhar" id="detalhar" image="/resources/images/arquivos.gif" title="Detalhar" style="width : 24px; height : 24px;"/>
											
						</nobr>
						</center>						
					</t:column>
									
					<t:column sortable="true" columnId="idArquivo">
						<f:facet name="header">
							<t:commandSortHeader columnName="colunaId" arrow="true">
								<h:outputText value="id" />
							</t:commandSortHeader>
						</f:facet>
						<h:outputText value="#{arq.id}"/>
					</t:column>
					
					<t:column sortable="true" columnId="nomeArquivo">
						<f:facet name="header">
							<t:commandSortHeader columnName="nome" arrow="true">
								<h:outputText value="Nome" />
							</t:commandSortHeader>
						</f:facet>
						<h:outputText value="#{arq.nome}"/>
					</t:column>
					
					<t:column sortable="true" columnId="descricaoArquivo">
						<f:facet name="header">
							<t:commandSortHeader columnName="descricao" arrow="true">
								<h:outputText value="Descrição" />
							</t:commandSortHeader>
						</f:facet>
						<h:outputText value="#{arq.descricao}"/>
					</t:column>
					
					<t:column sortable="true" columnId="dataUploadArquivo">
						<f:facet name="header">
							<t:commandSortHeader columnName="data" arrow="true">
								<h:outputText value="Data Upload" />
							</t:commandSortHeader>
						</f:facet>
						<h:outputText value="#{arq.dataUpload}"/>
					</t:column>	
								
					<f:facet name="footer">
						<h:panelGroup rendered="#{empty gerenciaArquivo.arquivos}">
							<h:outputText value="#{msg['tabela.vazia']}" />
						</h:panelGroup>
					</f:facet>
				</t:dataTable>
				<h:panelGroup rendered="#{not empty gerenciaArquivo.arquivos}">
					<div id="menuNavegacao">
						<rich:dataScroller for="tabelaArquivos" maxPages="5" >
						</rich:dataScroller>
					</div>
				</h:panelGroup>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>